<?php

namespace app\adminapi\export;

use app\services\order\OtherOrderServices;

class BatchSendExport extends BaseExport
{
    protected $header = [
        '批次号', '操作时间', '操作人','操作类型','发货单数','成功单数','状态','描述'
    ];

    public function createData(array $where)
    {
        $list = app()->make(OtherOrderServices::class)->getBatchSendList($where)['list'];
        $data = [];
        foreach($list as $val){
            $data[] = [
                $val['id'],
                date('Y-m-d H:i:s',$val['add_time']),
                $val['uploader'],
                '批量发货',
                $val['total_nums'],
                $val['success_nums'],
                $val['status'] == 1 ? '完成' : '',
                $val['remark']
            ];
        }

        return $data;
    }
}